using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Device
{
	public class CarrierHold
	{
		public const int _RESET = 0;
		public const int _SET = 1;
		private int _value;
		private static int _size;
		private static CarrierHold[] _array;
		public static string[] displayStrings;
		public static CarrierHold[] displayValues;
		public static CarrierHold RESET;
		public static CarrierHold SET;
		public static CarrierHold IT_ENUM_MAX;
		static CarrierHold()
		{
			CarrierHold._size = 2;
			CarrierHold._array = new CarrierHold[CarrierHold._size];
			CarrierHold.displayStrings = new string[CarrierHold._size];
			CarrierHold.displayValues = new CarrierHold[CarrierHold._size];
			CarrierHold.RESET = new CarrierHold(0);
			CarrierHold.SET = new CarrierHold(1);
			CarrierHold.IT_ENUM_MAX = new CarrierHold(2147483647);
			CarrierHold.displayStrings[0] = "RESET";
			CarrierHold.displayStrings[1] = "SET";
			CarrierHold.displayValues[0] = CarrierHold.RESET;
			CarrierHold.displayValues[1] = CarrierHold.SET;
		}
		public static string ValueToString(CarrierHold val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = CarrierHold.displayStrings[0];
				break;
			case 1:
				result = CarrierHold.displayStrings[1];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static CarrierHold StringToValue(string val)
		{
			CarrierHold result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = CarrierHold.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < CarrierHold.displayStrings.Length; i++)
				{
					if (val.Equals(CarrierHold.displayStrings[i]))
					{
						result = CarrierHold.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static CarrierHold From_Int(int value)
		{
			CarrierHold result;
			if (value >= 0 && value < CarrierHold._size)
			{
				result = CarrierHold._array[value];
			}
			else
			{
				result = CarrierHold.IT_ENUM_MAX;
			}
			return result;
		}
		protected CarrierHold(int value)
		{
			this._value = value;
			if (value >= 0 && value < CarrierHold._size)
			{
				CarrierHold._array[this._value] = this;
			}
		}
		public bool Equals(CarrierHold otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return CarrierHold.displayStrings[this._value];
		}
	}
}
